import std.stdio;
import std.traits;

enum hh : int
{
    a = 5
}

void main ()
{
    hh h = cast(hh)10;
    writeln(" h = ", h);
    assert(cast(int)h == 10);
    
    twrite("string aaa");
    twrite(cast(ubyte[])"string aaa");
    twrite(10);
    twrite(25.005);
    int[] aa = [10,20,10];
    twrite(aa);
    writeln("----------");
    double[][] dd = [[0.22,0.33], [0.23,0.56]];
    twrite(dd);
    writeln("overrrrr");
    
    
    hha!(20)();
    
    
    hha!(5)();
}

void hha(int b)()
{
    enum d = b -1;
    writeln("hha b : ", b.stringof);
     writeln("hha d : ", d.stringof);
}

void twrite(X)(X v) if(isNumeric!X)
{
    writeln("write x : ", X.stringof);
}

void twrite(X : int)(X v)
{
    writeln("write int : ", X.stringof);
}

void twrite(X : string)(X v)
{
    writeln("write string : ", X.stringof);
}

void twrite(X : ubyte[])(X v) 
{
    writeln("write ubyte[] : ", X.stringof);
    writeln("1111111111111");
    twrite(v[0]);
    writeln("1111111111111");
}

void twrite(X)(X v)if(isArray!X)
{
    writeln("write X[] : ", X.stringof);
    writeln(v);
    writeln("222222222222");
    auto a = v[0];
    twrite(v[0]);
    writeln("222222222222");
}
/*
void twrite(X:X[][])(X[][] v)
{
    writeln("write X[][] : ", X.stringof);
    writeln(v);
    writeln("222222222222");
    auto a = v[0];
    twrite(v[0]);
    writeln("222222222222");
}*/
